package org.tigris.subversion.svnant.commands;

import java.io.File;
import java.io.IOException;
import org.tigris.subversion.svnant.SvnAntUtilities;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.SVNClientException;

public class Propset extends SvnCommand
{
  private static final String MSG_CANT_SET_PROPERTY = "Can't set property %s";
  private File path = null;
  private File file;
  private String propName = null;
  private String propValue = null;
  private boolean recurse = false;

  public void execute()
  {
    try
    {
      if (this.propValue != null)
        getClient().propertySet(this.path, this.propName, this.propValue, this.recurse);
      else
        getClient().propertySet(this.path, this.propName, this.file, this.recurse);
    }
    catch (SVNClientException localSVNClientException)
    {
      throw ex(localSVNClientException, "Can't set property %s", new Object[] { this.propName });
    }
    catch (IOException localIOException)
    {
      throw ex(localIOException, "Can't set property %s", new Object[] { this.propName });
    }
  }

  protected void validateAttributes()
  {
    SvnAntUtilities.attrNotNull("path", this.path);
    SvnAntUtilities.attrNotEmpty("name", this.propName);
    SvnAntUtilities.attrsNotSet("value, file", true, new Object[] { this.propValue, this.file });
  }

  public void setPath(File paramFile)
  {
    this.path = paramFile;
  }

  public void setName(String paramString)
  {
    this.propName = paramString;
  }

  public void setValue(String paramString)
  {
    this.propValue = paramString;
  }

  public void setFile(File paramFile)
  {
    this.file = paramFile;
  }

  public void setRecurse(boolean paramBoolean)
  {
    this.recurse = paramBoolean;
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.commands.Propset
 * JD-Core Version:    0.6.0
 */